/**权限控制
------------------------------
--------------报表------------
------------------------------

1	报表
41	查看他人产品统计
74  	洞察 				----- 21/06/12 增
75	销售报表 				----- 21/06/17 增 
76  采购报表				----- 21/06/17 增
77  预约报表 				----- 21/06/17 增
78	统计报表 				----- 21/06/17 增 
**/


/**
------------------------------
--------------销售------------
------------------------------

2	销售 
6	开单
10	开单修改价格
11	开单经手人可改
12	开单时间可改
13	开单可负库存
14	单据收退款
48	查看库存
9	编辑单据
7	查看他人销售单
8	查看他人客户
32	客户经手人可改
70  客户收款
96  单据作废	--新增单据作废权    2021.08.17

103	查看客户	查看客户 2021-09-03 新增
104	删除客户	20210903 新增权限
**/

/**
------------------------------
--------------产品------------
------------------------------

4	产品 
22	新增产品
23	编辑产品
24	删除产品
33	产品标签
25	上架设置
26	成本可见
38	产品经手人可改
39	查看他人产品
**/
/**
------------------------------
--------------设置------------
------------------------------

5	设置
37	安全设置
27	我的企业
28	我的云店
29	门店设置
30	成员管理
42	采购设置
35	产品配置
73  预约设置
36	销售设置
43	仓库管理
31	基础设置 
-------------
50	服务设置
**/


/**
------------------------------
--------------采购------------
------------------------------

3	采购
40	开单
15	查看库存==编辑
16	查看供应商
17	查看他人单据
21	开单修改价格
20	单据经手人可改
19	单据时间可改
18	单据付款
44	供应商经手人可改
49	售价可见
72  供应商收款

97 单据作废 ——- —新增单据作废权 2021.08.17

105 查看供应商 ——- 查看供应商 20210903 新增
106 删除供应商 ——- 删除供应商 2021-09-03 新增
/**
------------------------------
--------------账务------------
------------------------------

45	账务
46	查看他人收款
47	查看他人付款

**/

/*
------------------------------
--------------预约  = 之前的销售模块 开单------------
------------------------------

51  预约 
52	开单
53	开单修改价格
54	开单经手人可改
55	开单时间可改
56	单据收退款
57	编辑单据
58	查看他人销售单
59	客户经手人可改
60	查看他人客户
71  客户收款
**/

/*
------------------------------
--------------服务  = 之前的 产品------------
------------------------------ 

61 	服务
62	新增服务
63	编辑服务
64	删除服务
65	服务标签
66	上架设置
67	成本可见
68	服务经手人可改
69	查看他人产品
**/

/*****************
****互动模块
141 互动模块权限
*****/
import localStore from "../LocalStore.js";

var accessCtrl = {

	list: [], //权限列表

	LIMIT_REPORT: 1, //报表
	LIMIT_GD_STATISTICS: 41, //查看他人产品统计
	LIMIT_SEE_CLEARLY: 74, //洞察 				----- 21/06/12 增

	LIMIT_SALE_REPORT: 75, //75	销售报表 				----- 21/06/17 增 
	LIMIT_PURCHASE_REPORT: 76, //	76  采购报表				----- 21/06/17 增
	LIMIT_SUBSCRIBE_REPORT: 77, //77  预约报表 				----- 21/06/17 增
	LIMIT_STATISTICS_REPORT: 78, //78	统计报表 				----- 21/06/17 增 

	//--------------销售------------

	LIMIT_SALE: 2, //销售 
	LIMIT_BILL: 6, //开单
	LIMIT_CHANGE_PRICE: 10, //开单修改价格
	LIMIT_BILL_CHANGE_MANAGER: 11, //开单经手人可改
	LIMIT_BILL_CHANGE_TIME: 12, //开单时间可改
	LIMIT_BILL_NEGATIVE_STOCK: 13, //开单可负库存
	LIMIT_BILL_COLLECT_REFUND: 14, //单据收退款
	LIMIT_VIEW_INVENTORY: 48, //查看库存
	LIMIT_EDIT_BILL: 9, //编辑单据
	LIMIT_VIEW_OTHER_S_B: 7, //查看他人销售单
	LIMIT_VIEW_OTHER_CUSTOMER: 8, //查看他人客户
	LIMIT_CUSTOM_MANAGER_CHANGE: 32, //客户经手人可改
	LIMIT_CUSTOM_REFUND: 70, //客户收款

	LIMIT_BILL_CANCEL: 96, //96  单据作废	--新增单据作废权
	LIMIT_SEE_CUSTOMER: 103, //查看客户	查看客户 2021-09-03 新增
	LIMIT_DEL_CUSTOMER: 104, //删除客户	20210903 新增权限


	//--------------产品------------
	LIMIT_GDS: 4, //产品 
	LIMIT_GDS_ADD: 22, //新增产品
	LIMIT_GDS_EDIT: 23, //编辑产品
	LIMIT_GDS_DEL: 24, //删除产品
	LIMIT_GDS_TAG: 33, //产品标签
	LIMIT_GDS_ONSALE: 25, //上架设置
	LIMIT_GDS_COST_SEE: 26, //成本可见
	LIMIT_GDS_MANAGER_CHANGE: 38, //产品经手人可改
	LIMIT_GDS_VIEW_OTHER: 39, //查看他人产品

	//--------------设置------------
	LIMIT_SET: 5, //设置
	LIMIT_SET_SAFE: 37, //安全设置
	LIMIT_SET_CP: 27, //我的企业
	LIMIT_SET_YD: 28, //我的云店
	LIMIT_SET_SHOP: 29, //门店设置
	LIMIT_SET_STAFFI: 30, //成员管理
	LIMIT_SET_PURCHASE: 42, //采购设置
	LIMIT_SET_GDS_DEPLOY: 35, //产品配置
	LIMIT_SET_YY: 73, //预约设置
	LIMIT_SET_SALE: 36, //销售设置
	LIMIT_SET_STOCK: 43, //仓库管理
	LIMIT_SET_BASE: 31, //基础设置
	LIMIT_SET_CUSTOMER: 100, // 客户设置
	LIMIT_SET_SUPPLIER: 101, // 供应商设置
	LIMIT_SET_KG: 102, // 库管设置
	LIMIT_DEV_DEVICE: 147, //设备仪器
	LIMIT_DEV_DEVICE_LIST: 1471, //设备列表
	LIMIT_DEV_DEVICE_SET: 1472, //开机次数

	//--------------采购------------
	LIMIT_PURCH: 3, //采购
	LIMIT_PURCH_WRITE_BILL: 40, //开单
	LIMIT_PURCH_VIEW_QTY_EDIT: 15, //查看库存==编辑
	LIMIT_PURCH_VIEW_OTHER_SUPPLIER: 16, //查看他人供应商
	LIMIT_PURCH_VIEW_OTHER_BILL: 17, //查看他人单据
	LIMIT_PURCH_EDIT_PRICE: 21, //开单修改价格
	LIMIT_PURCH_EDIT_MANAGER: 20, //单据经手人可改
	LIMIT_PURCH_EDIT_TIME: 19, //单据时间可改
	LIMIT_PURCH_BILL_PAY: 18, //单据付款
	LIMIT_PURCH_EDIT_SUPP_MANAGER: 44, //供应商经手人可改
	LIMIT_PURCH_SALE_VIEW: 49, //售价可见
	LIMIT_PURCH_SUPPLIER_COLLERCTION: 72, //供应商收款
	LIMIT_PURCH_BILL_CANCEL: 97, //97 单据作废 ——- —新增单据作废权 2021.08.17
	LIMIT_PURCH_VIEW_SUPPLIER: 105, //105 查看供应商 ——- 查看供应商 20210903 新增
	LIMIT_PURCH_DEL_SUPPLY: 106, //106 删除供应商 ——- 删除供应商 2021-09-03 新增

	//--------------账务------------
	LIMIT_FINANCE_ACCOUNT: 45, //账务
	LIMIT_FINANCE_VIEW_OTHER_COLLERCTION: 46, //查看他人收款
	LIMIT_FINANCE_VIEW_OTHER_PAY: 47, //查看他人付款

	//--------------预约  = 之前的销售模块 开单------------
	LIMIT_YY: 51, //预约 
	LIMIT_YY_BILL: 52, //开单
	LIMIT_YY_EDIT_PRICE: 53, //开单修改价格
	LIMIT_YY_EDIT_MANAGER: 54, //开单经手人可改
	LIMIT_YY_EDIT_TIME: 55, //开单时间可改
	LIMIT_YY_COLLERTION_REFUND: 56, //单据收退款
	LIMIT_YY_EDIT_BILL: 57, //编辑单据
	LIMIT_YY_VIEW_OTHER_SALE: 58, //查看他人销售单
	LIMIT_YY_EDIT_CUSTOM_MANAGER: 59, //客户经手人可改
	LIMIT_YY_VIEW_OTHER_CUSTOMER: 60, //查看他人客户
	LIMIT_YY_CUSTOM_COLLERTION: 71, //客户收款
	LIMIT_YY_EFFECTIVE_DATE: 145, // 更改有效日期
	//	--------------服务  = 之前的 产品------------
	LIMIT_PROJECT: 61, //服务
	LIMIT_PROJECT_ADD: 62, //新增服务
	LIMIT_PROJECT_EDIT: 63, //编辑服务
	LIMIT_PROJECT_DEL: 64, //删除服务
	LIMIT_PROJECT_TAG: 65, //服务标签
	LIMIT_PROJECT_ONSALE: 66, //上架设置
	LIMIT_PROJECT_VIEW_COST: 67, //成本可见
	LIMIT_PROJECT_EDIT_MANAGER: 68, //服务经手人可改
	LIMIT_PROJECT_VIEW_GD: 69, //查看他人产品
	

	//	--------------营销------------
	LIMIT_MARKETING: 83, //营销
	LIMIT_MARKETING_DISCOUNT: 84, //限时优惠
	LIMIT_MARKETING_DOUGH: 109, //拼团优惠
	LIMIT_MARKETING_SGORT_MESSAGE: 110, //短信营销
	LIMIT_MARKETING_INTEGRAL: 111, //积分体系
	LIMIT_MARKETING_DISTRIBUTION: 112, //客户分销
	LIMIT_MARKETING_GRADE: 115, //等级模块
	LIMIT_MARKETING_SECKILL: 116, //限时秒杀
	LIMIT_MARKETING_SIGNIN: 117, //签到模块
	LIMIT_MARKETING_SECKILLAMY: 118, //限时秒杀，艾蜜运平台独有
	LIMIT_MARKETING_SIGNINAMY: 119, //签到模块，艾蜜运平台独有
	LIMIT_MARKETING_CONSUMER_TREASURE: 120, //消费宝，艾蜜运平台独有
	LIMIT_MARKETING_CONSUMER_COUPON: 121, //消费券，艾蜜运平台独有
	LIMIT_MARKETING_EXTNSION: 133, //推广页
	LIMIT_MARKETING_RECHARGE: 134, //充值有礼
	LIMIT_INTER_ACTIVE: 141, // 互动模块
	LIMIT_MARKETING_TP_BM: 148, //投票/报名
	LIMIT_MARKETING_SAOMAO_ORDER: 1444, //扫码下单

	// --------------库管------------
	LIMIT_STOREKEEEPER: 85, // 库管
	LIMIT_STOREKEEEPER_VIEW: 88, // 库管可见
	LIMIT_STOREKEEEPER_CODE_INTO: 851, //入库单
	LIMIT_STOREKEEEPER_CODE_OUT: 852, //出库单
	LIMIT_STOREKEEEPER_CODE_TRANSFER:853, // 调拨单

	LIMIT_STOREKEEEPER_WAREHOUSE: 89, //仓库可见
	LIMIT_STOREKEEEPER_WAREHOUSE_KUCUN: 891, //库存
	LIMIT_STOREKEEEPER_WAREHOUSE_CANGKU: 892, //仓库

	LIMIT_STOREKEEEPER_DOCUMENT: 90, //单据
	LIMIT_STOREKEEEPER_EDIT_PRICE: 91, // 开单修改价格

	LIMIT_STOREKEEEPER_EDIT: 93, //编辑单据
	LIMIT_STOREKEEEPER_VOID: 99, //单据作废
	LIMIT_STOREKEEEPER_DETELE: 137, //删除作废的单据

	LIMIT_STOREKEEEPER_TODO: 87, // 待办可见
	LIMIT_STOREKEEEPER_TODO_INTO: 871,
	LIMIT_STOREKEEEPER_TODO_OUT: 872,
	LIMIT_STOREKEEEPER_TODO_TRANSFER: 873,

	LIMIT_STOREKEEEPER_EDIT_MANAGER: 94, //单据经手人可改
	LIMIT_STOREKEEEPER_EDIT_TIME: 95, //单据时间可改

	LIMIT_STOREKEEEPER_EDIT_SALE_PRICE: 107, //售价可见
	LIMIT_STOREKEEEPER_EDIT_PURCHASE_PRICE: 108, //采购价可见

	// --------------库管------------
	

};

/***设置权限*****/
accessCtrl.setLimit = function (value) {
	this.list = value;
}

/****获取权限*****/
accessCtrl.getLimits = async function (value) {

	if (!this.list || this.list && this.list.length == 0) {
		this.list = await localStore.getLimits();
	}

	let arr = this.list;
	let len = arr.length;

	for (let i = 0; i < len; i++) {
		if (arr[i] == value) {
			return true;
		}
	}
	return false;
}

/******************设置*********BEGIN********/

accessCtrl.getLimitgdsdeploy = function () {
	return this.getLimits(this.LIMIT_SET_GDS_DEPLOY);
}
accessCtrl.getLimitdevDevice = function () {
	return this.getLimits(this.LIMIT_DEV_DEVICE);
}

/******************设置*********END********/


/******************报表*********BEGIN********/
// LIMIT_REPORT : 1,	//报表
// LIMIT_GD_STATISTICS : 41,	//查看他人产品统计
// LIMIT_SEE_CLEARLY : 74,  	//洞察 				----- 21/06/12 增

// LIMIT_SALE_REPORT : 75,//75	销售报表 				----- 21/06/17 增 
// LIMIT_PURCHASE_REPORT : 76,//	76  采购报表				----- 21/06/17 增
// LIMIT_SUBSCRIBE_REPORT : 77,//77  预约报表 				----- 21/06/17 增
// LIMIT_STATISTICS_REPORT : 78,//78	统计报表 				----- 21/06/17 增 
//预约报表 
accessCtrl.getLimitSubscribeReprot = function () {
	return this.getLimits(this.LIMIT_SUBSCRIBE_REPORT);
}

//报表权限
accessCtrl.getLimitReprot = function () {
	return this.getLimits(this.LIMIT_REPORT);
}

//查看他人产品统计权限
accessCtrl.getLimitGDStaistics = function () {
	return this.getLimits(this.LIMIT_GD_STATISTICS);
}

/*****洞察 权限******/
accessCtrl.getLimitSeeClearly = function () {
	return this.getLimits(this.LIMIT_SEE_CLEARLY);
}

/***销售报表 ***/
accessCtrl.getLimitSaleReport = function () {
	return this.getLimits(this.LIMIT_SALE_REPORT);
}

/*****采购报表*****/
accessCtrl.getLimitPurchReport = function () {
	return this.getLimits(this.LIMIT_PURCHASE_REPORT);
}

/*******统计报表 ********/
accessCtrl.getLimitStockReport = function () {
	return this.getLimits(this.LIMIT_STATISTICS_REPORT);
}

/******************报表*********END********/

/**************开单权限*******BEGIN**********/
// LIMIT_CHANGE_PRICE : 10,	//开单修改价格
// LIMIT_BILL_CHANGE_MANAGER : 11,	//开单经手人可改
// LIMIT_BILL_CHANGE_TIME : 12,	//开单时间可改
// LIMIT_BILL_NEGATIVE_STOCK : 13,	//开单可负库存
// LIMIT_BILL_COLLECT_REFUND : 14,	//单据收退款
// LIMIT_VIEW_INVENTORY: 48,	//查看库存
// LIMIT_EDIT_BILL : 9,	//编辑单据
// LIMIT_VIEW_OTHER_S_B : 7,	//查看他人销售单
// LIMIT_VIEW_OTHER_CUSTOMER: 8,	//查看他人客户
// LIMIT_CUSTOM_MANAGER_CHANGE : 32,	//客户经手人可改
// LIMIT_CUSTOM_REFUND : 70,  //客户收款

// LIMIT_BILL_CANCEL : 96, //96  单据作废	--新增单据作废权
// LIMIT_SEE_CUSTOMER : 103,//查看客户	查看客户 2021-09-03 新增
// LIMIT_DEL_CUSTOMER : 104, //删除客户	20210903 新增权限



/*********开单修改价格*******/
accessCtrl.getLimitChangePrice = function () {
	return this.getLimits(this.LIMIT_CHANGE_PRICE);
}

/********开单经手人可改*******/
accessCtrl.getLimitBillChangeManger = function () {
	return this.getLimits(this.LIMIT_BILL_CHANGE_MANAGER);
}

/***开单时间可改****/
accessCtrl.getLimitBillChangeTime = function () {
	return this.getLimits(this.LIMIT_BILL_CHANGE_TIME);
}

/****开单可负库存****/
accessCtrl.getLimitBillNegaStock = function () {
	return this.getLimits(this.LIMIT_BILL_NEGATIVE_STOCK);
}

/****单据收退款****/
accessCtrl.getLimitBillCollRefu = function () {
	return this.getLimits(this.LIMIT_BILL_COLLECT_REFUND);
}

/****查看库存****/
accessCtrl.getLimitBillViewInven = function () {
	return this.getLimits(this.LIMIT_VIEW_INVENTORY);
}

/********编辑单据********/
accessCtrl.getLimitBillEdit = function () {
	return this.getLimits(this.LIMIT_EDIT_BILL);
}

/********查看他人销售单********/
accessCtrl.getLimitBillViewOther = function () {
	return this.getLimits(this.LIMIT_VIEW_OTHER_S_B);
}

/********查看他人客户********/
accessCtrl.getLimitViewOtherCustom = function () {
	return this.getLimits(this.LIMIT_VIEW_OTHER_CUSTOMER);
}

/********客户经手人可改********/
accessCtrl.getLimitChangeCustManger = function () {
	return this.getLimits(this.LIMIT_CUSTOM_MANAGER_CHANGE);
}

/****客户收款******/
accessCtrl.getLimitCoustomRefu = function () {
	return this.getLimits(this.LIMIT_CUSTOM_REFUND);
}

/********单据作废*********/
accessCtrl.getLimitBillCancel = function () {
	return this.getLimits(this.LIMIT_BILL_CANCEL);
}

/*******查看客户**********/
accessCtrl.getLimitSeeCustomer = function () {
	return this.getLimits(this.LIMIT_SEE_CUSTOMER);
}

accessCtrl.getLimitDelCustomer = function () {
	return this.getLimits(this.LIMIT_DEL_CUSTOMER);
}
/**************开单权限*******END**********/


/***销售权限，控制产品，开单****/
accessCtrl.getSaleLimit = function () {
	return this.getLimits(this.LIMIT_SALE);
}

/***获取产品权限*****/
accessCtrl.getGoodsLimit = function () {
	return this.getLimits(this.LIMIT_GDS);
}

/****添加产品权限****/
accessCtrl.getGdsAddLimit = function () {
	return this.getLimits(this.LIMIT_GDS_ADD);
}

/****编辑,复制产品权限*******/
accessCtrl.getGdsEditLimit = function () {
	return this.getLimits(this.LIMIT_GDS_EDIT);
}

/*******删除产品权限*******/
accessCtrl.getGdsDelLimit = function () {
	return this.getLimits(this.LIMIT_GDS_DEL);
}

/****产品标签权限******/
accessCtrl.getGdsTgsLimit = function () {
	return this.getLimits(this.LIMIT_GDS_TAG);
}

/****上架权限******/
accessCtrl.getGdsOnSale = function () {
	return this.getLimits(this.LIMIT_GDS_ONSALE);
}

/***成本可见权限*****/
accessCtrl.getGdsCostSeeLimit = function () {
	return this.getLimits(this.LIMIT_GDS_COST_SEE);
}

/*******经手是否可以更改********/
accessCtrl.getGdsManagerChangeLimit = function () {
	return this.getLimits(this.LIMIT_GDS_MANAGER_CHANGE);
}

/***销售开单权限*****/
accessCtrl.getBillLimit = function () {
	return this.getLimits(this.LIMIT_BILL);
}


/**********采购开单***BEGIN******/
/******
LIMIT_PURCH : 3,	//采购
LIMIT_PURCH_WRITE_BILL : 40,	//开单
LIMIT_PURCH_VIEW_QTY_EDIT : 15,	//查看库存==编辑
LIMIT_PURCH_VIEW_OTHER_SUPPLIER  : 16,	//查看供应商
LIMIT_PURCH_VIEW_OTHER_BILL : 17,	//查看他人单据
LIMIT_PURCH_EDIT_PRICE : 21,	//开单修改价格
LIMIT_PURCH_EDIT_MANAGER : 20,	//单据经手人可改
LIMIT_PURCH_EDIT_TIME : 19,	//单据时间可改
LIMIT_PURCH_BILL_PAY : 18,	//单据付款
LIMIT_PURCH_EDIT_SUPP_MANAGER : 44,	//供应商经手人可改
LIMIT_PURCH_SALE_VIEW : 49,	//售价可见
LIMIT_PURCH_SUPPLIER_COLLERCTION: 72 , //供应商收款
LIMIT_PURCH_BILL_CANCEL : 97,//97 单据作废 ——- —新增单据作废权 2021.08.17
LIMIT_PURCH_VIEW_SUPPLIER : 105,//105 查看供应商 ——- 查看供应商 20210903 新增
LIMIT_PURCH_DEL_SUPPLY : 106,//106 删除供应商 ——- 删除供应商 2021-09-03 新增
*****/
/**********采购开单***BEGIN******/
/**LIMIT_PURCH_DEL_SUPPLY : 106,//106 删除供应商 ——- 删除供应商 2021-09-03 新增**/
accessCtrl.getPurchDelSupplyLimit = function () {
	return this.getLimits(this.LIMIT_PURCH_DEL_SUPPLY);
}

/**LIMIT_PURCH_VIEW_SUPPLIER : 105,//105 查看供应商 ——- 查看供应商 20210903 新增**/
accessCtrl.getPurchViewSupplierLimit = function () {
	return this.getLimits(this.LIMIT_PURCH_VIEW_SUPPLIER);
}

/**LIMIT_PURCH_BILL_CANCEL : 97,//97 单据作废 ——- —新增单据作废权 2021.08.17**/
accessCtrl.getPurchBillCancelLimit = function () {
	return this.getLimits(this.LIMIT_PURCH_BILL_CANCEL);
}

/**LIMIT_PURCH_SUPPLIER_COLLERCTION: 72 , //供应商收款****/
accessCtrl.getPurchSuppCollerLimit = function () {
	return this.getLimits(this.LIMIT_PURCH_SUPPLIER_COLLERCTION);
}

/**LIMIT_PURCH_SALE_VIEW : 49,	//售价可见****/
accessCtrl.getPurchSaleViewLimit = function () {
	return this.getLimits(this.LIMIT_PURCH_SALE_VIEW);
}

/**LIMIT_PURCH_EDIT_SUPP_MANAGER : 44,	//供应商经手人可改****/
accessCtrl.getPurchEditSuppMangerLimit = function () {
	return this.getLimits(this.LIMIT_PURCH_EDIT_SUPP_MANAGER);
}

/**LIMIT_PURCH_BILL_PAY : 18,	//单据付款******/
accessCtrl.getPurchBillPayLimit = function () {
	return this.getLimits(this.LIMIT_PURCH_BILL_PAY);
}

/**LIMIT_PURCH_EDIT_TIME : 19,	//单据时间可改******/
accessCtrl.getPurchEditTimeLimit = function () {
	return this.getLimits(this.LIMIT_PURCH_EDIT_TIME);
}

/**LIMIT_PURCH_EDIT_MANAGER : 20,	//单据经手人可改******/
accessCtrl.getPurchEditMangerLimit = function () {
	return this.getLimits(this.LIMIT_PURCH_EDIT_MANAGER);
}

/***LIMIT_PURCH_EDIT_PRICE : 21,	//开单修改价格********/
accessCtrl.getPurchEditPriceLimit = function () {
	return this.getLimits(this.LIMIT_PURCH_EDIT_PRICE);
}

/*******LIMIT_PURCH_VIEW_OTHER_BILL : 17,	//查看他人单据********/
accessCtrl.getPurchViewOtherBillLimit = function () {
	return this.getLimits(this.LIMIT_PURCH_VIEW_OTHER_BILL);
}

/********LIMIT_PURCH_VIEW_OTHER_SUPPLIER  : 16,	//查看他人供应商******/
accessCtrl.getPurchViewOtherSupplierLimit = function () {
	return this.getLimits(this.LIMIT_PURCH_VIEW_OTHER_SUPPLIER);
}

/******LIMIT_PURCH_VIEW_QTY_EDIT : 15,	//查看库存==编辑***************/
accessCtrl.getPurchViewQtyEditLimit = function () {
	return this.getLimits(this.LIMIT_PURCH_VIEW_QTY_EDIT);
}

/****LIMIT_PURCH_WRITE_BILL : 40,	//开单****/
accessCtrl.getPurchWriteBillLimit = function () {
	return this.getLimits(this.LIMIT_PURCH_WRITE_BILL);
}

/***采购**LIMIT_PURCH : 3,	//采购***/
accessCtrl.getPurchLimit = function () {
	return this.getLimits(this.LIMIT_PURCH);
}


/**********预约开单***BEGIN******/
/******
	LIMIT_YY: 51, //预约 
	LIMIT_YY_BILL: 52, //开单
	LIMIT_YY_EDIT_PRICE: 53, //开单修改价格
	LIMIT_YY_EDIT_MANAGER: 54, //开单经手人可改
	LIMIT_YY_EDIT_TIME: 55, //开单时间可改
	LIMIT_YY_COLLERTION_REFUND: 56, //单据收退款
	LIMIT_YY_EDIT_BILL: 57, //编辑单据
	LIMIT_YY_VIEW_OTHER_SALE: 58, //查看他人销售单
	LIMIT_YY_EDIT_CUSTOM_MANAGER: 59, //客户经手人可改
	LIMIT_YY_VIEW_OTHER_CUSTOMER: 60, //查看他人客户
	LIMIT_YY_CUSTOM_COLLERTION: 71, //客户收款
*****/
/**********预约开单***BEGIN******/
// 查看服务
accessCtrl.getAboutLimit = function () {
	return this.getLimits(this.LIMIT_PROJECT);
}
// 查看顾客
accessCtrl.getViewOtherCustomerLimit = function () {
	return this.getLimits(this.LIMIT_YY_VIEW_OTHER_CUSTOMER);
}

// 预约模块
accessCtrl.getyyLimit = function () {
	return this.getLimits(this.LIMIT_YY);
}
// 预约开单
accessCtrl.getyyBillLimit = function () {
	return this.getLimits(this.LIMIT_YY_BILL);
}
//查看销售单
accessCtrl.getViewOtherSaleLimit = function () {
	return this.getLimits(this.LIMIT_YY_VIEW_OTHER_SALE);
}

/**********营销***BEGIN******/
/******
	LIMIT_MARKETING: 83, //营销
	LIMIT_MARKETING_DISCOUNT: 84, //限时优惠
	LIMIT_MARKETING_DOUGH: 109, //拼团优惠
	LIMIT_MARKETING_SGORT_MESSAGE: 110, //短信营销
	LIMIT_MARKETING_INTEGRAL: 111, //积分体系
	LIMIT_MARKETING_DISTRIBUTION: 112, //客户分销
	LIMIT_MARKETING_GRADE: 115, //等级模块
	LIMIT_MARKETING_SECKILL: 116, //限时秒杀
	LIMIT_MARKETING_SIGNIN: 117, //签到模块
	LIMIT_MARKETING_SECKILLAMY: 118, //限时秒杀，艾蜜运平台独有
	LIMIT_MARKETING_SIGNINAMY: 119, //签到模块，艾蜜运平台独有
	LIMIT_MARKETING_CONSUMER_TREASURE: 120, //消费宝，艾蜜运平台独有
	LIMIT_MARKETING_CONSUMER_COUPON: 121, //消费券，艾蜜运平台独有
	LIMIT_MARKETING_EXTNSION: 133, //推广
	LIMIT_MARKETING_RECHARGE: 134, //充值有礼
*****/
/**********营销***BEGIN******/
//营销
accessCtrl.getMarketingLimit = function () {
	return this.getLimits(this.LIMIT_MARKETING);
}
//限时优惠
accessCtrl.getDiscountLimit = function () {
	return this.getLimits(this.LIMIT_MARKETING_DISCOUNT);
}
//拼团优惠
accessCtrl.getSgortDoughLimit = function () {
	return this.getLimits(this.LIMIT_MARKETING_DOUGH);
}
/***投票报名*****/
accessCtrl.getLimitMarketingTpBm = function () {
	return this.getLimits(this.LIMIT_MARKETING_TP_BM);
}

/***分销有礼*****/
accessCtrl.getLimitMarketingDistrGifts = function () {
	return this.getLimits(this.LIMIT_MARKETING_DISTRIBUTION);
}
/***充值有礼*****/
accessCtrl.getLimitMarketingRechargeGifts = function () {
	return this.getLimits(this.LIMIT_MARKETING_RECHARGE);
}
/***积分体系*****/
accessCtrl.getLimitMarketingPointsGifts = function () {
	return this.getLimits(this.LIMIT_MARKETING_INTEGRAL);
}
/***限时秒杀*****/
accessCtrl.getLimitMarketingTimeLimitSeckill = function () {
	return this.getLimits(this.LIMIT_MARKETING_SECKILL);
}
/***限时优惠/限时抢购*****/
accessCtrl.getLimitMarketingTimeLimitDiscount = function () {
	return this.getLimits(this.LIMIT_MARKETING_DISCOUNT);
}
/***拼团优惠*****/
accessCtrl.getLimitMarketingTimeLimitGroup = function () {
	return this.getLimits(this.LIMIT_MARKETING_DOUGH);
}
/***会员签到*****/
accessCtrl.getLimitMarketingSignIn = function () {
	return this.getLimits(this.LIMIT_MARKETING_SIGNIN);
}
/***扫码下单*****/
accessCtrl.getLimitMarketingScanCodeOrder = function () {
	return this.getLimits(this.LIMIT_MARKETING_SIGNIN);
}
/***会员等级*****/
accessCtrl.getLimitMarketingMemberLevel = function () {
	return this.getLimits(this.LIMIT_MARKETING_GRADE);
}
/***短信营销*****/
accessCtrl.getLimitMarketingSmsMarket = function () {
	return this.getLimits(this.LIMIT_MARKETING_GRADE);
}
/***推广*****/
accessCtrl.getLimitMarketingExtension = function () {
	return this.getLimits(this.LIMIT_MARKETING_EXTNSION);
}

// --------------------------------------- 库管模块 satart -------------------------------
// 库管
accessCtrl.getStorekeeperLimit = function () {
	return this.getLimits(this.LIMIT_STOREKEEEPER);
}
// 库管可见
accessCtrl.getStorekeeperViewLimit = function () {
	return this.getLimits(this.LIMIT_STOREKEEEPER_VIEW);
}

// 待办
accessCtrl.getStorekeeperTodoLimit = function () {
	return this.getLimits(this.LIMIT_STOREKEEEPER_TODO);
}

// 单据
accessCtrl.getStorekeeperDocumentLimit = function () {
	return this.getLimits(this.LIMIT_STOREKEEEPER_DOCUMENT);
}

// 编辑单据
accessCtrl.getStorekeeperEditLimit = function () {
	return this.getLimits(this.LIMIT_STOREKEEEPER_EDIT);
}
// 单据作废
accessCtrl.getStorekeeperVoidLimit = function () {
	return this.getLimits(this.LIMIT_STOREKEEEPER_VOID);
}

// 删除作废的单据
accessCtrl.getStorekeeperDeleteLimit = function () {
	return this.getLimits(this.LIMIT_STOREKEEEPER_DETELE);
}

// 仓库
accessCtrl.getStorekeeperWarehouseLimit = function () {
	return this.getLimits(this.LIMIT_STOREKEEEPER_WAREHOUSE);
}

// 开单修改价格
accessCtrl.getStorekeeperEditPriceLimit = function () {
	return this.getLimits(this.LIMIT_STOREKEEEPER_EDIT_PRICE);
}

// 单据经手人可改
accessCtrl.getStorekeeperEditManagerLimit = function () {
	return this.getLimits(this.LIMIT_STOREKEEEPER_EDIT_MANAGER);
}

// 单据时间可改
accessCtrl.getStorekeeperEditTimeLimit = function () {
	return this.getLimits(this.LIMIT_STOREKEEEPER_EDIT_TIME);
}

// 售价可见
accessCtrl.getStorekeeperEditSalePriceLimit = function () {
	return this.getLimits(this.LIMIT_STOREKEEEPER_EDIT_SALE_PRICE);
}

// 采购价可见
accessCtrl.getStorekeeperEditPurchasePriceLimit = function () {
	return this.getLimits(this.LIMIT_STOREKEEEPER_EDIT_PURCHASE_PRICE);
}

// --------------------------------------- 库管模块 end -------------------------------


/**********设置***BEGIN******/
/******
LIMIT_SET: 5, //设置
LIMIT_SET_SAFE: 37, //安全设置
LIMIT_SET_CP: 27, //我的企业
LIMIT_SET_YD: 28, //我的云店
LIMIT_SET_SHOP: 29, //门店设置
LIMIT_SET_STAFFI: 30, //成员管理
LIMIT_SET_PURCHASE: 42, //采购设置
LIMIT_SET_GDS_DEPLOY: 35, //产品配置
LIMIT_SET_YY: 73, //预约设置
LIMIT_SET_SALE: 36, //销售设置
LIMIT_SET_STOCK: 43, //仓库管理
LIMIT_SET_BASE: 31, //基础设置 
LIMIT_SET_CUSTOMER: 100, // 客户设置
LIMIT_SET_SUPPLIER: 101, // 供应商设置
LIMIT_SET_KG: 102, // 库管设置
*****/
/**********设置***BEGIN******/

//设置
accessCtrl.getSetLimit = function () {
	return this.getLimits(this.LIMIT_SET);
}
//安全设置
accessCtrl.getSetSafeLimit = function () {
	return this.getLimits(this.LIMIT_SET_SAFE);
}
//我的企业
accessCtrl.getSetCpLimit = function () {
	return this.getLimits(this.LIMIT_SET_CP);
}
//我的云店
accessCtrl.getSetYdLimit = function () {
	return this.getLimits(this.LIMIT_SET_YD);
}
//门店设置
accessCtrl.getSetShopLimit = function () {
	return this.getLimits(this.LIMIT_SET_SHOP);
}
//成员管理
accessCtrl.getSetStaffiLimit = function () {
	return this.getLimits(this.LIMIT_SET_STAFFI);
}
//采购设置
accessCtrl.getSetPurchaseLimit = function () {
	return this.getLimits(this.LIMIT_SET_PURCHASE);
}
//预约设置
accessCtrl.getSetYyLimit = function () {
	return this.getLimits(this.LIMIT_SET_YY);
}
//销售设置
accessCtrl.getSetSaleLimit = function () {
	return this.getLimits(this.LIMIT_SET_SALE);
}
//仓库管理
accessCtrl.getSetStockLimit = function () {
	return this.getLimits(this.LIMIT_SET_STOCK);
}
//客户设置
accessCtrl.getSetCustomerLimit = function () {
	return this.getLimits(this.LIMIT_SET_CUSTOMER);
}
//供应商设置
accessCtrl.getSetSupplierLimit = function () {
	return this.getLimits(this.LIMIT_SET_SUPPLIER);
}
//库管设置
accessCtrl.getSetKgLimit = function () {
	return this.getLimits(this.LIMIT_SET_KG);
}
//基础设置
accessCtrl.getSetBaseLimit = function () {
	return this.getLimits(this.LIMIT_SET_BASE);
}


//我的云店
accessCtrl.getsetydLimit = function () {
	return this.getLimits(this.LIMIT_SET_YD);
}

/***互动权限*****/
accessCtrl.getLimitInterActive = function () {
	return this.getLimits(this.LIMIT_INTER_ACTIVE);
}

/***财务权限*****/
accessCtrl.getLimitFinanceAccount = function () {
	return this.getLimits(this.LIMIT_FINANCE_ACCOUNT);
}

/***财务查看收款权限*****/
accessCtrl.getLimitFinanceCollerction = function () {
	return this.getLimits(this.LIMIT_FINANCE_VIEW_OTHER_COLLERCTION);
}
/***财务查看付款权限*****/
accessCtrl.getLimitFinancePay = function () {
	return this.getLimits(this.LIMIT_FINANCE_VIEW_OTHER_PAY);
}
/***更改有效日期权限*****/
accessCtrl.getLimitYyEffctiveDate = function () {
	return this.getLimits(this.LIMIT_YY_EFFECTIVE_DATE);
}

export default accessCtrl






